package android15.samples;

import java.util.ArrayList;

import android.graphics.drawable.Drawable;

import com.google.android.maps.ItemizedOverlay;
import com.google.android.maps.OverlayItem;

public class HelloItemizedOverlay extends ItemizedOverlay<OverlayItem> {
	public HelloItemizedOverlay(Drawable defaultMarker) {
		super(boundCenterBottom(defaultMarker));
	}

	private ArrayList<OverlayItem> _overlayItems = new ArrayList<OverlayItem>();

	@Override 
	protected OverlayItem createItem(int i) {
	     return _overlayItems.get(i);
	 }

	@Override
	public int size() {
	    return _overlayItems.size();
	}
	
	public void addOverlay(OverlayItem overlay) {
	    _overlayItems.add(overlay);
	    populate();
	}

}
